package com.lp.reactor8;

import java.util.Observable;

public class ObserverDemo extends Observable {

    public static void main(String[] args) {
        ObserverDemo demo = new ObserverDemo();
        demo.addObserver((o, arg) -> System.out.println("手动被观察者通知，准备改变"));
        demo.addObserver((o, arg) -> System.out.println("发生变化"));
        demo.setChanged();
        demo.notifyObservers();
    }
}
